package com.util;

import java.util.List;

import org.apache.struts.action.ActionMessage;
import org.apache.struts.action.ActionMessages;

public class BuildMessages {
	public static ActionMessages build(List list){
		ActionMessages messages = new ActionMessages();
		for(int i = 0;i < list.size();i ++){
			messages.add(messages.GLOBAL_MESSAGE, new ActionMessage("messages.nomkey",(String)list.get(i)));
		}
		return messages;		
	}
	
	public static ActionMessages build(String key){
		ActionMessages messages = new ActionMessages();
		messages.add(messages.GLOBAL_MESSAGE, new ActionMessage(key));
		return messages;		
	}	
}
